home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 423 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: tko.dec.com!diamond
  2. From: diamond@tko.dec.com (Norman Diamond)
  3. Newsgroups: comp.std.c
  4. Subject: Re: CLOCKS_PER_SEC not defined
  5. Date: 19 Feb 1996 03:14:28 GMT
  6. Organization: Digital Equipment Corporation Japan , Tokyo
  7. Message-ID: <4g8puk$2ce@usenet.pa.dec.com>
  8. References: <ramin.1174728902A@news.gsfc.nasa.gov>
  9. Reply-To: diamond@jrdv04.enet.dec-j.co.jp (Norman Diamond)
  10. NNTP-Posting-Host: jit533.tko.dec.com
  11.  
  12. In article <ramin.1174728902A@news.gsfc.nasa.gov>, ramin@twinkie.gsfc.nasa.gov (Ramin Sina) writes:
  13. >I am using a supposedly ansi c program in which I write
  14.  
  15. Do you mean you are using a supposedly ANSI C implementation?  If the
  16. vendor's documents assert that it is, and if you have followed the
  17. vendor's instructions for invoking it (i.e. if you have not opted,
  18. whether by default or by specifying an option, for a non-conforming
  19. implementation) then you should get a refund.
  20.  
  21. If you mean that you are writing a supposedly ANSI C program, then
  22. your test for __STDC__ is meaningless :-)
  23.  
  24. If you mean that you want to cover most bases, then check if __STDC__
  25. is defined with value 1.  Some non-conforming implementations define
  26. __STDC__ with value 0 just to be malicious.  Some non-conforming
  27. implementations define __STDC__ with value 1 in order to be fraudulent.
  28. The C standard cannot constrain non-conforming implementations but you
  29. can demand a refund from a fraudulent vendor.
  30.  
  31. >#include <time.h>
  32. >#if defined(__STDC__) && !defined(CLOCKS_PER_SEC)
  33. >#error "CLOCKS_PER_SEC is not defined on this stupid compiler"
  34. >#endif
  35.  
  36. Try:
  37.  
  38.  #include <time.h>
  39.  #if defined(__STDC__) && __STDC__ == 1 && !defined(CLOCKS_PER_SEC)
  40.  #error "Get a refund from the fraudulent vendor of this implementation"
  41.  #endif
  42. --
  43.  <<  If this were the company's opinion, I would not be allowed to post it.  >>
  44. "I paid money for this car, I pay taxes for vehicle registration and a driver's
  45. license, so I can drive in any lane I want, and no innocent victim gets to call
  46. the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
  47.